package day05;

/**
 * @author yzh
 * @desc TODO
 * @date 2025/4/14
 */
public class StringApi {
    public static void main(String[] args) {
        String str = "hello string";
        String str2 = "hello";
        String str3 = "hello String";
        String str4 = "  String  ";
        System.out.println(str.length());
        System.out.println(str.charAt(0));
        System.out.println(str.indexOf(101));
        System.out.println(str.lastIndexOf(101));
        System.out.println(str.substring(6));
        System.out.println(str.replace("string","world"));
        System.out.println(str.compareTo(str2));
        System.out.println(str.compareToIgnoreCase(str3));
        System.out.println(str.equals(str3));
        System.out.println(str.equalsIgnoreCase(str3));
        System.out.println(str2.concat(" world"));
        System.out.println(str4.trim());
    }
}
